<?php
namespace common\models;

use yii\db\ActiveRecord;
use common\models\Tree;
use backend\components\Utools;

class Department extends ActiveRecord
{

    /**
     * 部门表
     */
    public static function tableName()
    {
        return '{{%department}}';
    }
    
    /**
    * 验证规则
    */
    public function rules()
    {
        return[
            [['siteid','dp_id','status'],'integer'],
            [['dp_name'],'required','message'=>'必填'],
            [['display','listorder'], 'default', 'value'=>'0'],
        ];
    }

    /**
     * 属性标签
    */
    public function attributeLabels()
    {
        return [
            'dp_id' => '部门ID',
            'dp_name'=>'部门名称',
            'parentid'=>'父级ID',
            'arrparentid'=>'父级ID数组',
            'arrchildid'=>'子级ID数组',
            'siteid'=>'站点ID',
            'display'=>'展示',
            'status'=>'状态',
            'listorder'=>'排序',
        ];
    }


}

?>